package utils;

import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.view.Gravity;
import android.view.View;
import android.widget.TextView;

import student.andlei.com.student.R;

public class ViewUtils {
    @SuppressLint("WrongConstant")
    public static View GetEmptyView(Context context){
        TextView view = new TextView(context);
        view.setText("您还没有课程哦~");
        Drawable dra = context.getResources().getDrawable(R.mipmap.img_kong);
        dra.setBounds( 0, DensityUtil.dp2pxInt(0), dra.getMinimumWidth(),dra.getMinimumHeight());
        view.setCompoundDrawables(null,dra,null,null);
        view.setCompoundDrawablePadding(DensityUtil.dp2pxInt(10));
        view.setTextSize(DensityUtil.dp2px(20));
        view.setGravity(Gravity.CENTER);
//        view.setLayoutDirection(LayoutDirection.INHERIT);
        view.setTextColor(context.getResources().getColor(R.color.fontcolor));
        return view;
    }
    public static View GetClassEmptyView(Context context){
        TextView view_rank = new TextView(context);
        view_rank.setText("您还没有加入任何班级哦~");
        view_rank.setTextSize(DensityUtil.dp2px(20));
        view_rank.setPadding(20, 50, 20, 20);
        view_rank.setTextSize(DensityUtil.dp2px(20));
        view_rank.setGravity(Gravity.CENTER);
        view_rank.setTextColor(context.getResources().getColor(R.color.fontcolor));
        return view_rank;
    }
    public static View GetNoticeEmptyView(Context context,String strcontent){
        TextView view_rank = new TextView(context);
        view_rank.setText(strcontent+"~");
        view_rank.setTextSize(DensityUtil.dp2px(20));
        view_rank.setPadding(20, 50, 20, 20);
        view_rank.setTextSize(DensityUtil.dp2px(20));
        view_rank.setGravity(Gravity.CENTER);
        view_rank.setTextColor(context.getResources().getColor(R.color.fontcolor));
        return view_rank;
    }
}
